using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using MinimalistFoodStreet.BackEnd.Infrastructure.Dtos.Request.Tables;
using MinimalistFoodStreet.BackEnd.Server.IServer.Tables;

namespace MinimalistFoodStreet.BackEnd.Api.Api.Controllers.Tables
{
    public class ActionLogsController : BaseController
    {
        private readonly IActionLogsServer _iActionLogsServer;

        public ActionLogsController(IActionLogsServer iActionLogsServer)
        {
            _iActionLogsServer = iActionLogsServer;
        }

        /// <summary>
        /// 分页
        /// </summary>
        /// <param name="page">当前是第几页</param>
        /// <param name="limit">一页有多少条数据</param>
        /// <param name="key">要查询的关键字</param>
        /// <param name="begain">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="requestMethod">请求方法</param>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> Pagination(int page, int limit, string? key, DateTime? begain, DateTime? end, string? requestMethod)
        {
            return Send(await _iActionLogsServer.PaginationAsync(page, limit, key, begain, end,requestMethod));
        }
    }
}
